home *** CD-ROM | disk | FTP | other *** search
- #include <stdlib.h>
- #include <MacTypes.h>
- #include <oops.h>
- #include <CXBugHCDemo.h>
- #include <SetUpA4.h>
- #include <string.h>
-
- /* The user must set this to a 1 when debugging and a 0 when compiling */
- #define XDebugging 1
-
- /***************************** Main *******************************/
- pascal
- void main(MainparamPtr)
- XCmdPtr MainparamPtr;
- {
- /************************************************************/
- CXBug *thePipe; /* This must stay in every project */
- /************************************************************/
- /* User Demo Variables */
- Str255 arg0, arg1; /* arguments passed in via params */
- Handle StringHandle; /* Because we need a handle for this particular argument */
- Handle FldHdl; /* a C string with the contents of a field */
- Str255 aMessage;
- /****************************************************************************/
- /****************************************************************************/
- /* Set up HyperXBug, this must be here for all HyperXBug programs. */
- /* The only thing the user will change is a library in the project */
- /* During Debug he will use the Bugging.proj as a lib. To comiple, use
- DoneBugging.proj as a lib and set the project type to code resource ala
- pg 85 in the THINK C User's Manual. */
- SetUpHyperXBug(MainparamPtr, thePipe); /* DO NOT REMOVE FROM MAIN FILE */
- /****************************************************************************/
- /****************************************************************************/
-
-
- /*************** Beginning of User Code ******************************************/
-
- /* Get the 0th arg from params */
- HLock(thePipe->paramPtr->params[0]);
- strcpy(arg0, *(thePipe->paramPtr->params[0]));
- HUnlock(thePipe->paramPtr->params[0]);
-
- /* Get the 1st arg from params */
- HLock(thePipe->paramPtr->params[1]);
- strcpy(arg1, *(thePipe->paramPtr->params[1]));
- HUnlock(thePipe->paramPtr->params[1]);
-
- /* Here's a good place to halt and look at what you've got */
- strcat(arg0, arg1);
- StringHandle = NewHandle(256L);
- HLock(StringHandle);
- strcpy(*StringHandle, arg0);
-
- thePipe->SetFieldByName(1,("Ralph"), StringHandle); /* Put a string into a field */
- FldHdl = thePipe->GetFieldByName(1,("Ralph")); /* Get a string from a field */
-
- NumToString(7L,aMessage); /* turn number into string */
- thePipe->paramPtr->returnValue = thePipe->PasToZero(aMessage); /* Std Callback */
-
- HUnlock(StringHandle);
- HUnlock(FldHdl);
-
- /*************** End of User Code *******************************************/
-
-
- /**********************************************************************************/
- /**********************************************************************************/
- /**** Clean up after HyperXBug. This must also stay in this file */
- /**********************************************************************************/
- CleanUpHyperXBug(thePipe); /* DO NOT REMOVE FROM MAIN FILE */
- /**********************************************************************************/
- /**********************************************************************************/
-
- }
-